//
//  TitleButton.swift
//  swift-微博
//
//  Created by chenrin on 2016/12/15.
//  Copyright © 2016年 zhuoheng. All rights reserved.
//

import UIKit

class TitleButton: UIButton {

    
   override init(frame: CGRect) {
        super.init(frame: frame)
        setTitleColor(UIColor.darkGray, for: .normal)
        setImage(UIImage(named:"navigationbar_arrow_down"), for: .normal)
        setImage(UIImage(named:"navigationbar_arrow_up"), for: .selected)
        self.sizeToFit()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
   override func layoutSubviews() {
    super.layoutSubviews()
    titleLabel?.frame.origin.x = 0
    imageView?.frame.origin.x = (titleLabel?.frame.size.width)!
    
    }

}
